<template>
    <div class="right vipLevel">
        <div class="level_tit tit clearfix">
            <span class="pull-left">订单列表</span>
        </div>
        <table class="table table-striped" id="level">
            <thead>
                <th>订单编号</th>
                <th>下单时间</th>
                <th>收件人</th>
                <th>订单金额</th>
                <th>订单状态</th>
                <th>操作</th>
            </thead>
            <tbody>
               <tr v-for='(obj,ind) in orders'>
                    <td>{{obj.number}}</td>
                    <td>
                        <p>{{obj.send}}</p>
                        <p>{{obj.time}}</p>
                    </td>
                    <td>
                        <p>{{obj.receive}}</p>
                        <p>{{obj.address}}</p>
                    </td>
                    <td>￥{{obj.money}}</td>
                    <td><span v-if="!obj.state">未付款</span><span v-if="obj.state">已付款</span></td>
                    <td>
                        <router-link :to="{name:'orderDetail',params:cur}"><img src="../images/look_07.jpg" alt="" v-on:click="look(ind)"/></router-link>
                        <img src="../images/operate_icon_11.jpg" alt="" v-on:click="dele(ind)" />
                    </td>
               </tr>
            </tbody>
        </table>
    </div>
</template>
<script>
    import orders from '../js/orders'

    export default{
        data(){
            return{
                orders:orders,
                cur:null
            }
        },
        methods:{
            dele(ind){
                this.orders.splice(ind,1);
            },
            look(ind){
                this.cur = this.orders[ind];
            }
        },
        watch:{
            "$route":"pars"
        }
    }
</script>
<style lang="css" scoped>
    .level_tit{
        background:url("../images/order_03.jpg") 5px 25px no-repeat;
        padding-bottom:10px;
    }
</style>